Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove empty entries automatically #9894

Merged
merged 8 commits into from
May 15, 2023
Merged

Remove empty entries automatically #9894

merged 8 commits into from
May 15, 2023

Conversation

koppor
Copy link
Member

@koppor koppor commented May 15, 2023

Fixes #8645.

Empty entries IMHO do not contain any information.

Exmaple for empty entries:

@misc{}

@article{}

With a citation key or any other field, they are not empty:

@misc{test}

@article{test2}

This PR adds a functionality so that these entries are automatically removed while writing.

Outdated

In case they are removed, JabRef will (udate NOT) issue a warning "changed on disk". I think, this warning is OK, isn't it?

image

Compulsory checks

@Siedlerchr
Copy link
Member

This defeats the purpose of the dialog. I would rather have an option to automatically always delete them

@koppor
Copy link
Member Author

koppor commented May 15, 2023

The dialog was there to warn about null information being in the library.

Is there anyone wanting to keep information that an entry with @article is in the database?

Back in #8096 (comment), we agreed that deleting the entries is a solution.

I updated the PR link to link the issue which explains why empty entries cause a headache: #8645

@Siedlerchr
Copy link
Member

Not happy about this leading to a changed on disk

@koppor
Copy link
Member Author

koppor commented May 15, 2023

Not happy about this leading to a changed on disk

Fixed.

@koppor
Copy link
Member Author

koppor commented May 15, 2023

This (now) also fixes #8645, because isEmpty currently includes a check for auto generated fields:

@Article{,
  creationdate = {2022-04-05T10:41:54},
  owner        = {mlep},
}

Siedlerchr
Siedlerchr previously approved these changes May 15, 2023
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 15, 2023
calixtus
calixtus previously approved these changes May 15, 2023
# Conflicts:
#	src/main/java/org/jabref/model/database/BibDatabaseContext.java
@koppor koppor dismissed stale reviews from calixtus and Siedlerchr via 6fc8908 May 15, 2023 18:42
@Siedlerchr Siedlerchr merged commit dc60b4d into main May 15, 2023
@Siedlerchr Siedlerchr deleted the remove-empty-entries branch May 15, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An empty entry can still be added without warning message (and lead to an error when compiling)
3 participants